package com.ghxxzx.daglcustom.bussiness_assignees;

import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.tmsps.ne4spring.utils.wrapper.WrapMapper;
import org.tmsps.ne4spring.utils.wrapper.Wrapper;

import java.util.ArrayList;
import java.util.List;

/**
 * 查找员工
 *
 */
@RestController
@RequestMapping("/assignees/assignee")
public class AssigneeController {

	/**
	 * 员工列表
	 * 
	 * @param name 根据姓名查询
	 * @return
	 */
	@GetMapping("/list")
	public Wrapper<List<JSONObject>> list(String name) {
		List<JSONObject> list = new ArrayList<>();

		JSONObject user1 = new JSONObject();
		user1.put("code", "2001");
		user1.put("name", "张三");
		list.add(user1);

		JSONObject user2 = new JSONObject();
		user2.put("code", "2002");
		user2.put("name", "李四");
		list.add(user2);

		JSONObject user3 = new JSONObject();
		user3.put("code", "2003");
		user3.put("name", "王五");
		list.add(user3);

		return WrapMapper.ok(list);
	}

}
